home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 23
/
Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso
/
Aminet
/
misc
/
emu
/
amiSPIMsrc.lha
/
y.tab.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-01-19
|
67KB
|
2,422 lines
# define Y_NL 257
# define Y_INT 258
# define Y_ID 259
# define Y_REG 260
# define Y_FP_REG 261
# define Y_STR 262
# define Y_FP 263
# define Y_ABS_D_OP 264
# define Y_ABS_S_OP 265
# define Y_ADDIU_OP 266
# define Y_ADDI_OP 267
# define Y_ADDU_OP 268
# define Y_ADD_D_OP 269
# define Y_ADD_OP 270
# define Y_ADD_S_OP 271
# define Y_ANDI_OP 272
# define Y_AND_OP 273
# define Y_BC0F_OP 274
# define Y_BC0T_OP 275
# define Y_BC1F_OP 276
# define Y_BC1T_OP 277
# define Y_BC2F_OP 278
# define Y_BC2T_OP 279
# define Y_BC3F_OP 280
# define Y_BC3T_OP 281
# define Y_BEQ_OP 282
# define Y_BGEZAL_OP 283
# define Y_BGEZ_OP 284
# define Y_BGTZ_OP 285
# define Y_BLEZ_OP 286
# define Y_BLTZAL_OP 287
# define Y_BLTZ_OP 288
# define Y_BNE_OP 289
# define Y_BREAK_OP 290
# define Y_CFC0_OP 291
# define Y_CFC1_OP 292
# define Y_CFC2_OP 293
# define Y_CFC3_OP 294
# define Y_COP0_OP 295
# define Y_COP1_OP 296
# define Y_COP2_OP 297
# define Y_COP3_OP 298
# define Y_CTC0_OP 299
# define Y_CTC1_OP 300
# define Y_CTC2_OP 301
# define Y_CTC3_OP 302
# define Y_CVT_D_S_OP 303
# define Y_CVT_D_W_OP 304
# define Y_CVT_S_D_OP 305
# define Y_CVT_S_W_OP 306
# define Y_CVT_W_D_OP 307
# define Y_CVT_W_S_OP 308
# define Y_C_EQ_D_OP 309
# define Y_C_EQ_S_OP 310
# define Y_C_F_D_OP 311
# define Y_C_F_S_OP 312
# define Y_C_LE_D_OP 313
# define Y_C_LE_S_OP 314
# define Y_C_LT_D_OP 315
# define Y_C_LT_S_OP 316
# define Y_C_NGE_D_OP 317
# define Y_C_NGE_S_OP 318
# define Y_C_NGLE_D_OP 319
# define Y_C_NGLE_S_OP 320
# define Y_C_NGL_D_OP 321
# define Y_C_NGL_S_OP 322
# define Y_C_NGT_D_OP 323
# define Y_C_NGT_S_OP 324
# define Y_C_OLE_D_OP 325
# define Y_C_OLE_S_OP 326
# define Y_C_SEQ_D_OP 327
# define Y_C_SEQ_S_OP 328
# define Y_C_SF_D_OP 329
# define Y_C_SF_S_OP 330
# define Y_C_UEQ_D_OP 331
# define Y_C_UEQ_S_OP 332
# define Y_C_ULE_D_OP 333
# define Y_C_ULE_S_OP 334
# define Y_C_UN_D_OP 335
# define Y_C_UN_S_OP 336
# define Y_DIVU_OP 337
# define Y_DIV_D_OP 338
# define Y_DIV_OP 339
# define Y_DIV_S_OP 340
# define Y_JALR_OP 341
# define Y_JAL_OP 342
# define Y_JR_OP 343
# define Y_J_OP 344
# define Y_LBU_OP 345
# define Y_LB_OP 346
# define Y_LHU_OP 347
# define Y_LH_OP 348
# define Y_LUI_OP 349
# define Y_LWC0_OP 350
# define Y_LWC1_OP 351
# define Y_LWC2_OP 352
# define Y_LWC3_OP 353
# define Y_LWL_OP 354
# define Y_LWR_OP 355
# define Y_LW_OP 356
# define Y_MFC0_OP 357
# define Y_MFC1_OP 358
# define Y_MFC2_OP 359
# define Y_MFC3_OP 360
# define Y_MFHI_OP 361
# define Y_MFLO_OP 362
# define Y_MOV_D_OP 363
# define Y_MOV_S_OP 364
# define Y_MTC0_OP 365
# define Y_MTC1_OP 366
# define Y_MTC2_OP 367
# define Y_MTC3_OP 368
# define Y_MTHI_OP 369
# define Y_MTLO_OP 370
# define Y_MULTU_OP 371
# define Y_MULT_OP 372
# define Y_MUL_D_OP 373
# define Y_MUL_S_OP 374
# define Y_NEG_D_OP 375
# define Y_NEG_S_OP 376
# define Y_NOR_OP 377
# define Y_ORI_OP 378
# define Y_OR_OP 379
# define Y_PFW_OP 380
# define Y_RFE_OP 381
# define Y_SB_OP 382
# define Y_SH_OP 383
# define Y_SLLV_OP 384
# define Y_SLL_OP 385
# define Y_SLTIU_OP 386
# define Y_SLTI_OP 387
# define Y_SLTU_OP 388
# define Y_SLT_OP 389
# define Y_SRAV_OP 390
# define Y_SRA_OP 391
# define Y_SRLV_OP 392
# define Y_SRL_OP 393
# define Y_SUBU_OP 394
# define Y_SUB_D_OP 395
# define Y_SUB_OP 396
# define Y_SUB_S_OP 397
# define Y_SWC0_OP 398
# define Y_SWC1_OP 399
# define Y_SWC2_OP 400
# define Y_SWC3_OP 401
# define Y_SWL_OP 402
# define Y_SWR_OP 403
# define Y_SW_OP 404
# define Y_SYSCALL_OP 405
# define Y_TLBP_OP 406
# define Y_TLBR_OP 407
# define Y_TLBWI_OP 408
# define Y_TLBWR_OP 409
# define Y_XORI_OP 410
# define Y_XOR_OP 411
# define Y_ABS_POP 412
# define Y_BAL_POP 413
# define Y_BEQZ_POP 414
# define Y_BGEU_POP 415
# define Y_BGE_POP 416
# define Y_BGTU_POP 417
# define Y_BGT_POP 418
# define Y_BLEU_POP 419
# define Y_BLE_POP 420
# define Y_BLTU_POP 421
# define Y_BLT_POP 422
# define Y_BNEZ_POP 423
# define Y_B_POP 424
# define Y_LA_POP 425
# define Y_LD_POP 426
# define Y_LI_POP 427
# define Y_LI_D_POP 428
# define Y_LI_S_POP 429
# define Y_L_D_POP 430
# define Y_L_S_POP 431
# define Y_MFC1_D_POP 432
# define Y_MTC1_D_POP 433
# define Y_MOVE_POP 434
# define Y_MULOU_POP 435
# define Y_MULO_POP 436
# define Y_MUL_POP 437
# define Y_NEGU_POP 438
# define Y_NEG_POP 439
# define Y_NOP_POP 440
# define Y_NOT_POP 441
# define Y_REMU_POP 442
# define Y_REM_POP 443
# define Y_ROL_POP 444
# define Y_ROR_POP 445
# define Y_SD_POP 446
# define Y_SEQ_POP 447
# define Y_SGEU_POP 448
# define Y_SGE_POP 449
# define Y_SGTU_POP 450
# define Y_SGT_POP 451
# define Y_SLEU_POP 452
# define Y_SLE_POP 453
# define Y_SNE_POP 454
# define Y_S_D_POP 455
# define Y_S_S_POP 456
# define Y_ULHU_POP 457
# define Y_ULH_POP 458
# define Y_ULW_POP 459
# define Y_USH_POP 460
# define Y_USW_POP 461
# define Y_ALIAS_DIR 462
# define Y_ALIGN_DIR 463
# define Y_ASCII_DIR 464
# define Y_ASCIIZ_DIR 465
# define Y_ASM0_DIR 466
# define Y_BGNB_DIR 467
# define Y_BYTE_DIR 468
# define Y_COMM_DIR 469
# define Y_DATA_DIR 470
# define Y_DOUBLE_DIR 471
# define Y_ENDB_DIR 472
# define Y_ENDR_DIR 473
# define Y_END_DIR 474
# define Y_ENT_DIR 475
# define Y_ERR_DIR 476
# define Y_EXTERN_DIR 477
# define Y_FILE_DIR 478
# define Y_FLOAT_DIR 479
# define Y_FMASK_DIR 480
# define Y_FRAME_DIR 481
# define Y_GLOBAL_DIR 482
# define Y_HALF_DIR 483
# define Y_K_TEXT_DIR 484
# define Y_K_DATA_DIR 485
# define Y_LABEL_DIR 486
# define Y_LCOMM_DIR 487
# define Y_LIVEREG_DIR 488
# define Y_LOC_DIR 489
# define Y_MASK_DIR 490
# define Y_NOALIAS_DIR 491
# define Y_OPTIONS_DIR 492
# define Y_RDATA_DIR 493
# define Y_REPEAT_DIR 494
# define Y_SDATA_DIR 495
# define Y_SET_DIR 496
# define Y_SPACE_DIR 497
# define Y_STRUCT_DIR 498
# define Y_TEXT_DIR 499
# define Y_VERSTAMP_DIR 500
# define Y_VREG_DIR 501
# define Y_WORD_DIR 502
# line 287 "parser.y"
#include <stdio.h>
#include "spim.h"
#include "spim-utils.h"
#include "inst.h"
#include "mem.h"
#include "reg.h"
#include "sym-tbl.h"
#include "data.h"
#include "scanner.h"
#include "parser.h"
/* return (0) */
#define LINE_PARSE_DONE YYACCEPT
/* return (1) */
#define FILE_PARSE_DONE YYABORT
typedef struct ll
{
label *head;
struct ll *tail;
} label_list;
/* Exported Variables: */
int data_dir; /* Non-zero means item in data segment */
int text_dir; /* Non-zero means item in text segment */
/* Local functions: */
#ifdef __STDC__
static imm_expr *branch_offset (int n_inst);
static void clear_labels (void);
static label_list *cons_label (label *head, label_list *tail);
static void div_inst (int op, int rd, int rs, int rt, int const_divisor);
static void mult_inst (int op, int rd, int rs, int rt);
static void nop_inst (void);
static void set_eq_inst (int op, int rd, int rs, int rt);
static void set_ge_inst (int op, int rd, int rs, int rt);
static void set_gt_inst (int op, int rd, int rs, int rt);
static void set_le_inst (int op, int rd, int rs, int rt);
static void store_word_data (int value);
static void trap_inst (void);
#else
static imm_expr *branch_offset ();
static void clear_labels ();
static label_list *cons_label ();
static void div_inst ();
static void mult_inst ();
static void nop_inst ();
static void set_eq_inst ();
static void set_ge_inst ();
static void set_gt_inst ();
static void set_le_inst ();
static void store_word_data ();
static void trap_inst ();
#endif
/* Local variables: */
static int null_term; /* Non-zero means string terminate by \0 */
static void (*store_op) (); /* Function to store items in an EXPR_LST */
static label_list *this_line_labels = NULL; /* List of label for curent line */
static int noat_flag = 0; /* Non-zero means program can use $1 */
static char *input_file_name; /* Name of file being parsed */
#define yyclearin yychar = -1
#define yyerrok yyerrflag = 0
extern int yychar;
extern short yyerrflag;
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 150
#endif
#ifndef YYSTYPE
#define YYSTYPE int
#endif
YYSTYPE yylval, yyval;
# define YYERRCODE 256
# line 2014 "parser.y"
/* Maintain and update the address of labels for the current line. */
#ifdef __STDC__
void
fix_current_label_address (mem_addr new_addr)
#else
void
fix_current_label_address (new_addr)
mem_addr new_addr;
#endif
{
label_list *l;
for (l = this_line_labels; l != NULL; l = l->tail)
l->head->addr = new_addr;
clear_labels ();
}
#ifdef __STDC__
static label_list *
cons_label (label *head, label_list *tail)
#else
static label_list *
cons_label (head, tail)
label *head;
label_list *tail;
#endif
{
label_list *c = (label_list *) malloc (sizeof (label_list));
c->head = head;
c->tail = tail;
return (c);
}
#ifdef __STDC__
static void
clear_labels (void)
#else
static void
clear_labels ()
#endif
{
label_list *n;
for ( ; this_line_labels != NULL; this_line_labels = n)
{
n = this_line_labels->tail;
free (this_line_labels);
}
}
/* Operations on op codes. */
#ifdef __STDC__
int
op_to_imm_op (int opcode)
#else
int
op_to_imm_op (opcode)
int opcode;
#endif
{
switch (opcode)
{
case Y_ADD_OP: return (Y_ADDI_OP);
case Y_ADDU_OP: return (Y_ADDIU_OP);
case Y_AND_OP: return (Y_ANDI_OP);
case Y_OR_OP: return (Y_ORI_OP);
case Y_XOR_OP: return (Y_XORI_OP);
case Y_SLT_OP: return (Y_SLTI_OP);
case Y_SLTU_OP: return (Y_SLTIU_OP);
case Y_SLLV_OP: return (Y_SLL_OP);
case Y_SRAV_OP: return (Y_SRA_OP);
case Y_SRLV_OP: return (Y_SRL_OP);
default: fatal_error ("Can't convert op to immediate op\n"); return (0);
}
}
#ifdef __STDC__
int
imm_op_to_op (int opcode)
#else
int
imm_op_to_op (opcode)
int opcode;
#endif
{
switch (opcode)
{
case Y_ADDI_OP: return (Y_ADD_OP);
case Y_ADDIU_OP: return (Y_ADDU_OP);
case Y_ANDI_OP: return (Y_AND_OP);
case Y_ORI_OP: return (Y_OR_OP);
case Y_XORI_OP: return (Y_XOR_OP);
case Y_SLTI_OP: return (Y_SLT_OP);
case Y_SLTIU_OP: return (Y_SLTU_OP);
case Y_J_OP: return (Y_JR_OP);
case Y_LUI_OP: return (Y_ADDU_OP);
case Y_SLL_OP: return (Y_SLLV_OP);
case Y_SRA_OP: return (Y_SRAV_OP);
case Y_SRL_OP: return (Y_SRLV_OP);
default: fatal_error ("Can't convert immediate op to op\n"); return (0);
}
}
#ifdef __STDC__
static void
nop_inst (void)
#else
static void
nop_inst ()
#endif
{
r_type_inst (Y_OR_OP, 0, 0, 0);
}
#ifdef __STDC__
static void
trap_inst (void)
#else
static void
trap_inst ()
#endif
{
r_type_inst (Y_BREAK_OP, 0, 0, 0);
}
#ifdef __STDC__
static imm_expr *
branch_offset (int n_inst)
#else
static imm_expr *
branch_offset (n_inst)
int n_inst;
#endif
{
return (const_imm_expr (n_inst << 2)); /* Later shifted right 2 places */
}
#ifdef __STDC__
static void
div_inst (int op, int rd, int rs, int rt, int const_divisor)
#else
static void
div_inst (op, rd, rs, rt, const_divisor)
int op, rd, rs, rt, const_divisor;
#endif
{
if (rd != 0 && !const_divisor)
{
i_type_inst_free (Y_BNE_OP, 0, rt, branch_offset (2));
trap_inst ();
}
if (op == Y_DIV_OP || op == Y_REM_POP)
r_type_inst (Y_DIV_OP, 0, rs, rt);
else
r_type_inst (Y_DIVU_OP, 0, rs, rt);
if (rd != 0)
{
if (op == Y_DIV_OP || op == Y_DIVU_OP)
r_type_inst (Y_MFLO_OP, rd, 0, 0);
else
r_type_inst (Y_MFHI_OP, rd, 0, 0);
}
}
#ifdef __STDC__
static void
mult_inst (int op, int rd, int rs, int rt)
#else
static void
mult_inst (op, rd, rs, rt)
int op, rd, rs, rt;
#endif
{
if (op == Y_MULOU_POP)
r_type_inst (Y_MULTU_OP, 0, rs, rt);
else
r_type_inst (Y_MULT_OP, 0, rs, rt);
if (op == Y_MULOU_POP && rd != 0)
{
r_type_inst (Y_MFHI_OP, 1, 0, 0); /* Use $at */
i_type_inst_free (Y_BEQ_OP, 0, 1, branch_offset (2));
trap_inst ();
}
else if (op == Y_MULO_POP && rd != 0)
{
r_type_inst (Y_MFHI_OP, 1, 0, 0); /* use $at */
r_type_inst (Y_MFLO_OP, rd, 0, 0);
r_sh_type_inst (Y_SRA_OP, rd, rd, 31);
i_type_inst_free (Y_BEQ_OP, rd, 1, branch_offset (2));
trap_inst ();
}
if (rd != 0)
r_type_inst (Y_MFLO_OP, rd, 0, 0);
}
#ifdef __STDC__
static void
set_le_inst (int op, int rd, int rs, int rt)
#else
static void
set_le_inst (op, rd, rs, rt)
int op, rd, rs, rt;
#endif
{
i_type_inst_free (Y_BNE_OP, rs, rt, branch_offset (3));
i_type_inst_free (Y_ORI_OP, rd, 0, const_imm_expr (1));
i_type_inst_free (Y_BEQ_OP, 0, 0, branch_offset (2));
r_type_inst ((op == Y_SLE_POP ? Y_SLT_OP : Y_SLTU_OP), rd, rs, rt);
}
#ifdef __STDC__
static void
set_gt_inst (int op, int rd, int rs, int rt)
#else
static void
set_gt_inst (op, rd, rs, rt)
int op, rd, rs, rt;
#endif
{
r_type_inst (op == Y_SGT_POP ? Y_SLT_OP : Y_SLTU_OP, rd, rt, rs);
}
#ifdef __STDC__
static void
set_ge_inst (int op, int rd, int rs, int rt)
#else
static void
set_ge_inst (op, rd, rs, rt)
int op, rd, rs, rt;
#endif
{
i_type_inst_free (Y_BNE_OP, rs, rt, branch_offset (3));
i_type_inst_free (Y_ORI_OP, rd, 0, const_imm_expr (1));
i_type_inst_free (Y_BEQ_OP, 0, 0, branch_offset (2));
r_type_inst (op == Y_SGE_POP ? Y_SLT_OP : Y_SLTU_OP, rd, rt, rs);
}
#ifdef __STDC__
static void
set_eq_inst (int op, int rd, int rs, int rt)
#else
static void
set_eq_inst (op, rd, rs, rt)
int op, rd, rs, rt;
#endif
{
imm_expr *if_eq, *if_neq;
if (op == Y_SEQ_POP)
if_eq = const_imm_expr (1), if_neq = const_imm_expr (0);
else
if_eq = const_imm_expr (0), if_neq = const_imm_expr (1);
i_type_inst_free (Y_BEQ_OP, rs, rt, branch_offset (3));
/* RD <- 0 (if not equal) */
i_type_inst_free (Y_ORI_OP, rd, 0, if_neq);
i_type_inst_free (Y_BEQ_OP, 0, 0, branch_offset (2)); /* Branch always */
/* RD <- 1 */
i_type_inst_free (Y_ORI_OP, rd, 0, if_eq);
}
/* Store the value either as a datum or instruction. */
#ifdef __STDC__
static void
store_word_data (int value)
#else
static void
store_word_data (value)
int value;
#endif
{
if (data_dir)
store_word (value);
else if (text_dir)
store_instruction (inst_decode (value));
}
#ifdef __STDC__
void
initialize_parser (char *file_name)
#else
void
initialize_parser (file_name)
char *file_name;
#endif
{
input_file_name = file_name;
only_id = 0;
data_dir = 0;
text_dir = 1;
}
#ifdef __STDC__
void
yyerror (char *s)
#else
void
yyerror (s)
char *s;
#endif
{
error ("spim: (parser) %s on line %d of file %s\n",
s, line_no, input_file_name);
print_erroneous_line ();
}
short yyexca[] ={
-1, 1,
0, -1,
-2, 0,
-1, 2,
259, 376,
-2, 5,
-1, 345,
260, 348,
-2, 346,
-1, 371,
259, 376,
-2, 375,
-1, 475,
257, 277,
-2, 363,
-1, 489,
257, 299,
-2, 363,
-1, 497,
257, 322,
-2, 363,
};
# define YYNPROD 378
# define YYLAST 869
short yyact[]={
9, 404, 476, 466, 472, 475, 479, 238, 237, 152,
151, 142, 240, 141, 239, 153, 143, 185, 181, 186,
182, 187, 183, 188, 184, 197, 190, 189, 191, 192,
194, 193, 198, 26, 229, 230, 231, 232, 471, 551,
480, 412, 233, 234, 235, 236, 247, 248, 249, 250,
251, 252, 271, 257, 269, 255, 281, 267, 279, 265,
280, 266, 276, 262, 278, 264, 282, 268, 273, 259,
277, 263, 275, 261, 272, 258, 274, 260, 270, 256,
165, 242, 164, 241, 210, 209, 208, 207, 110, 109,
112, 111, 121, 118, 124, 119, 120, 114, 115, 113,
219, 220, 222, 223, 215, 216, 214, 213, 224, 225,
227, 228, 217, 218, 172, 171, 244, 243, 254, 253,
161, 154, 145, 117, 139, 127, 128, 148, 158, 157,
156, 147, 146, 149, 159, 150, 160, 163, 246, 162,
245, 133, 136, 134, 135, 130, 131, 129, 140, 450,
400, 359, 405, 155, 144, 28, 212, 195, 202, 201,
200, 199, 206, 205, 204, 203, 196, 211, 13, 116,
14, 15, 16, 126, 125, 221, 226, 32, 170, 169,
168, 30, 29, 27, 31, 167, 166, 43, 42, 132,
179, 178, 177, 176, 175, 174, 173, 180, 138, 137,
123, 122, 17, 23, 22, 68, 69, 70, 71, 72,
73, 74, 75, 76, 78, 80, 81, 79, 82, 84,
83, 85, 86, 87, 88, 89, 90, 105, 77, 91,
92, 93, 94, 95, 96, 97, 99, 98, 100, 101,
102, 103, 104, 106, 107, 108, 326, 411, 298, 473,
388, 485, 299, 406, 392, 393, 4, 289, 309, 289,
289, 289, 292, 293, 289, 289, 405, 305, 499, 305,
305, 290, 512, 310, 290, 289, 289, 289, 289, 289,
289, 289, 289, 289, 289, 289, 289, 289, 494, 289,
289, 289, 289, 289, 289, 510, 429, 290, 290, 470,
386, 333, 334, 345, 358, 505, 349, 349, 349, 285,
334, 334, 580, 408, 565, 564, 310, 291, 563, 553,
360, 496, 495, 361, 493, 492, 357, 491, 488, 366,
487, 483, 399, 396, 395, 378, 373, 374, 403, 306,
394, 390, 389, 379, 385, 381, 382, 384, 383, 377,
375, 387, 361, 372, 397, 391, 361, 361, 342, 346,
468, 469, 368, 367, 364, 311, 287, 286, 297, 348,
408, 407, 290, 577, 572, 283, 347, 549, 284, 288,
352, 547, 439, 486, 557, 300, 489, 558, 303, 559,
582, 581, 294, 295, 296, 574, 573, 301, 302, 503,
566, 504, 474, 500, 497, 560, 576, 502, 312, 313,
314, 315, 316, 317, 318, 319, 320, 321, 322, 323,
324, 575, 327, 328, 329, 330, 331, 332, 5, 481,
350, 351, 353, 354, 355, 356, 555, 371, 304, 556,
477, 451, 402, 498, 401, 398, 409, 380, 376, 370,
369, 365, 413, 414, 415, 416, 363, 417, 418, 419,
420, 307, 308, 362, 67, 66, 65, 64, 63, 545,
62, 61, 60, 59, 58, 57, 546, 344, 548, 546,
56, 55, 54, 53, 408, 407, 408, 501, 453, 455,
457, 459, 548, 52, 51, 50, 49, 48, 47, 46,
548, 45, 44, 41, 40, 561, 562, 39, 38, 37,
36, 35, 34, 33, 25, 24, 21, 20, 478, 19,
506, 18, 12, 325, 11, 10, 484, 8, 7, 6,
3, 2, 1, 0, 490, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
570, 571, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 440, 335, 336, 337, 338, 339, 340, 341,
343, 0, 0, 0, 440, 440, 440, 440, 440, 334,
334, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 310, 310, 467, 467, 467, 0, 0, 0,
0, 0, 464, 465, 0, 0, 0, 0, 0, 0,
361, 0, 0, 0, 0, 482, 0, 0, 361, 550,
0, 0, 0, 0, 0, 410, 361, 447, 448, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 427, 0, 431, 0,
434, 436, 0, 0, 0, 461, 0, 0, 0, 462,
463, 0, 0, 440, 0, 440, 0, 0, 0, 440,
440, 0, 440, 0, 440, 440, 0, 0, 440, 440,
440, 440, 440, 440, 0, 0, 0, 0, 0, 0,
0, 0, 0, 334, 334, 0, 334, 334, 334, 334,
334, 334, 334, 334, 467, 0, 0, 0, 0, 0,
449, 452, 454, 456, 458, 0, 0, 0, 0, 0,
0, 361, 0, 0, 0, 552, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 554, 0, 0, 0,
0, 534, 535, 0, 537, 538, 539, 540, 541, 542,
543, 544, 0, 0, 0, 508, 0, 0, 0, 511,
0, 0, 515, 0, 517, 0, 519, 521, 0, 0,
523, 525, 527, 529, 531, 533, 0, 0, 0, 0,
536, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 567, 0, 569, 0, 0, 0, 0, 507,
568, 509, 0, 0, 0, 513, 514, 0, 516, 0,
518, 520, 578, 579, 522, 524, 526, 528, 530, 532,
0, 0, 0, 0, 0, 0, 421, 422, 423, 424,
425, 426, 428, 430, 432, 433, 435, 437, 438, 0,
0, 441, 442, 443, 444, 445, 446, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 460 };
short yypact[]={
-1000,-1000,-1000,-257, 317, 50,-1000, 110, 109,-1000,
11, 2, 11, 11, 11, -9, -9, 11, 11, -9,
11, 2, 11, 11, -9,-1000, 107,-1000, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11,-1000, 11,
11, 11, 11, 11, 11, 11, 11,-1000, 2, 11,
11, 11, 2, -9, -9, -9, -9, -9, 44, 62,
-1000,-1000,-1000, 106,-1000,-1000, 105, 104,-1000,-1000,
95,-1000,-1000,-1000,-1000, 92,-1000, 91, 11,-1000,
-1000,-1000,-1000, 90, 89, 86, 40,-1000, 62, 84,
83,-1000, 62, 62, 82, 76, 75, 11,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000, 74,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000, 226,-1000, 226, -16,-1000,-1000,
-222,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000, 11, 11, 11, 11, 11, 112, 38, 112,
11, 112, 112, 11, 11, 11,-1000, 11, 11, 11,
11, 11, 11,-1000,-1000,-1000,-1000, 11, 11, 11,
11, 11,-1000,-1000, 11,-1000,-1000, 2,-1000,-1000,
-1000, 2, 2, -9, -9, -9, -9, -9, 39,-1000,
-1000,-1000, -13, -13,-1000,-1000, 62,-1000,-1000,-223,
-1000,-1000,-1000, 73, 62, -11,-223, 72, 70,-1000,
-1000,-1000, 62, 69, 67, 66, 28,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000, 64, 63,-1000,-1000,
-1000, 228,-1000,-1000,-1000, 55,-1000, 356, 262,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000, 112,-1000, 37,-1000,
226,-1000, 14, 112,-1000, 112,-1000, 112, 112,-1000,
-1000, 112, 112, 112, 112, 112, 112,-1000,-1000,-1000,
-1000, 226,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000, -9,-1000,-1000,-1000,-1000,
-1000, -13,-1000, 323, -13,-1000, 319, 62,-1000,-224,
-1000,-1000,-1000,-1000,-1000,-1000,-224,-1000, 11,-1000,
-1000,-1000,-1000,-1000,-1000,-1000, 61,-1000,-1000, 11,
396, 344, 364, 55, 55, 60,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000, 57,-1000, 56,
-1000,-1000,-1000,-1000, 359, 11,-1000, 11, 55, 55,
312,-1000,-1000,-1000,-1000,-1000,-1000, 355,-1000, 354,
381, 366, 311,-1000,-1000, 11, 11, 54, 350, 349,
-1000,-1000,-1000 };
short yypgo[]={
0, 532, 531, 530, 529, 253, 528, 527, 525, 379,
150, 524, 317, 522, 338, 368, 521, 519, 517, 438,
516, 515, 258, 514, 523, 513, 382, 512, 511, 510,
509, 508, 507, 504, 503, 502, 501, 499, 498, 497,
301, 496, 495, 494, 149, 493, 483, 482, 481, 480,
477, 475, 474, 473, 369, 472, 471, 470, 468, 467,
3, 466, 465, 464, 151, 463, 38, 456, 451, 5,
450, 6, 449, 448, 246, 447, 445, 444, 443, 1,
441, 248, 4, 2, 440, 437, 429, 428 };
short yyr1[]={
0, 2, 1, 3, 3, 3, 4, 4, 4, 4,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 8, 8, 8, 8, 8, 8,
8, 8, 8, 11, 11, 11, 13, 16, 16, 17,
17, 17, 18, 18, 18, 18, 18, 18, 20, 20,
20, 21, 21, 21, 23, 23, 25, 25, 25, 25,
25, 25, 25, 27, 27, 27, 28, 28, 28, 28,
28, 28, 28, 29, 29, 29, 30, 31, 31, 32,
32, 32, 32, 33, 33, 33, 35, 35, 36, 36,
37, 37, 38, 38, 34, 34, 39, 39, 39, 39,
39, 39, 39, 39, 41, 41, 41, 41, 41, 41,
42, 42, 43, 43, 45, 45, 46, 46, 47, 47,
48, 48, 49, 49, 49, 49, 51, 51, 52, 52,
53, 53, 55, 55, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 57, 57, 57, 57, 57, 57,
57, 57, 58, 58, 59, 59, 59, 59, 59, 59,
59, 59, 61, 61, 61, 61, 61, 61, 62, 62,
63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
63, 63, 63, 63, 63, 63, 63, 63, 7, 7,
65, 7, 67, 7, 7, 7, 68, 7, 7, 7,
7, 7, 7, 70, 7, 7, 7, 7, 7, 7,
7, 7, 7, 73, 7, 7, 7, 7, 75, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 76, 7, 77, 10, 78, 78, 78, 78, 78,
78, 78, 78, 78, 78, 80, 44, 14, 14, 14,
14, 14, 79, 79, 79, 9, 24, 26, 50, 54,
19, 74, 15, 22, 60, 81, 12, 12, 40, 66,
66, 82, 82, 84, 83, 64, 64, 69, 69, 69,
71, 71, 85, 72, 86, 86, 87, 5 };
short yyr2[]={
0, 0, 3, 2, 3, 0, 2, 2, 1, 0,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 1, 2, 1, 3, 3,
3, 3, 3, 4, 4, 3, 4, 4, 3, 4,
3, 4, 4, 4, 4, 3, 4, 4, 3, 3,
4, 4, 4, 4, 3, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 2, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
2, 2, 3, 2, 3, 2, 2, 3, 3, 3,
4, 3, 3, 3, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 3, 2,
0, 3, 0, 3, 1, 2, 0, 3, 3, 1,
2, 1, 2, 0, 3, 2, 2, 1, 2, 3,
3, 1, 3, 0, 3, 3, 4, 2, 0, 3,
2, 3, 3, 3, 3, 3, 2, 2, 1, 2,
1, 2, 2, 2, 2, 1, 2, 1, 2, 3,
4, 0, 3, 0, 2, 3, 1, 4, 1, 4,
3, 3, 3, 6, 6, 0, 2, 1, 6, 1,
3, 3, 1, 3, 2, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
1, 1, 3, 0, 2, 1, 1, 2, 1, 3,
2, 1, 0, 2, 1, 0, 0, 2 };
short yychk[]={
-1000, -1, -2, -3, -5, -87, -4, -6, -7, 257,
-8, -11, -13, 425, 427, 428, 429, 459, -16, -17,
-18, -20, 461, 460, -21, -23, 290, 440, 412, 439,
438, 441, 434, -25, -27, -28, -29, -30, -31, -32,
-33, -34, 445, 444, -35, -36, -37, -38, -39, -41,
-42, -43, -45, -46, -47, -48, -49, -51, -52, -53,
-55, -56, -57, -58, -59, -61, -62, -63, 462, 463,
464, 465, 466, 467, 468, 469, 470, 485, 471, 474,
472, 473, 475, 477, 476, 478, 479, 480, 481, 482,
483, 486, 487, 488, 489, 490, 491, 492, 494, 493,
495, 496, 497, 498, 499, 484, 500, 501, 502, 346,
345, 348, 347, 356, 354, 355, 426, 380, 350, 352,
353, 349, 458, 457, 351, 431, 430, 382, 383, 404,
402, 403, 446, 398, 400, 401, 399, 456, 455, 381,
405, 270, 268, 273, 411, 379, 389, 388, 384, 390,
392, 267, 266, 272, 378, 410, 387, 386, 385, 391,
393, 377, 396, 394, 339, 337, 443, 442, 437, 436,
435, 372, 371, 453, 452, 451, 450, 449, 448, 447,
454, 275, 277, 279, 281, 274, 276, 278, 280, 284,
283, 285, 286, 288, 287, 414, 423, 282, 289, 418,
417, 416, 415, 422, 421, 420, 419, 344, 343, 342,
341, 424, 413, 364, 363, 361, 362, 369, 370, 357,
358, 432, 359, 360, 365, 366, 433, 367, 368, 291,
292, 293, 294, 299, 300, 301, 302, 265, 264, 271,
269, 340, 338, 374, 373, 397, 395, 303, 304, 305,
306, 307, 308, 376, 375, 312, 336, 310, 332, 326,
334, 330, 320, 328, 322, 316, 318, 314, 324, 311,
335, 309, 331, 325, 333, 329, 319, 327, 321, 315,
317, 313, 323, 58, 61, 259, 257, 257, -9, -74,
260, -12, 260, 261, -9, -9, -9, -15, -81, 261,
-15, -9, -9, -15, -19, -74, -12, -19, -19, -22,
-81, 258, -9, -9, -9, -9, -9, -9, -9, -9,
-9, -9, -9, -9, -9, -24, -74, -9, -9, -9,
-9, -9, -9, -40, -5, -24, -24, -24, -24, -24,
-24, -24, -40, -24, -50, -74, -40, -12, -54, -74,
-54, -54, -12, -15, -15, -15, -15, -22, 260, -64,
258, -5, -65, -67, 258, -68, -5, 258, 258, -70,
-72, -85, 258, -5, -5, 258, -73, 258, -74, -5,
-75, -5, -5, 258, 258, 258, 260, -5, -64, 258,
258, -5, -64, -64, 258, 258, 258, -74, -76, 258,
-10, -77, -10, -14, -79, 40, -5, 259, 258, -10,
-14, 263, 263, -10, -10, -10, -10, -10, -10, -10,
-10, -24, -24, -24, -24, -24, -24, -14, -24, 258,
-24, -14, -24, -24, -14, -24, -14, -24, -24, -26,
-74, -24, -24, -24, -24, -24, -24, -40, -40, -26,
-44, -80, -26, -44, -26, -44, -26, -44, -26, -44,
-24, -12, -12, -12, -22, -22, -60, -81, -60, -60,
260, -66, -82, 262, -66, -69, -83, -84, -64, -71,
263, -86, -5, 258, -64, 262, -71, 258, 258, -69,
-64, 258, 258, 258, 260, 258, 258, -69, -78, 40,
-79, 259, -79, 43, 45, 43, 258, -26, -14, -26,
258, -14, 258, -26, -26, -14, -26, -14, -26, -14,
-26, -14, -26, -14, -26, -14, -26, -14, -26, -14,
-26, -14, -26, -14, -40, -40, -14, -40, -40, -40,
-40, -40, -40, -40, -40, -60, -82, 58, -83, 58,
-64, 263, -74, 258, -74, 40, 43, 40, 43, 45,
41, -79, -79, 258, 258, 258, 41, -74, -5, -74,
-79, -79, 62, 41, 41, 40, 40, 62, -74, -74,
258, 41, 41 };
short yydef[]={
1, -2, -2, 9, 0, 0, 2, 0, 0, 8,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 25, 0, 27, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 376, 0,
0, 0, 0, 0, 0, 0, 376, 376, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 376,
270, 272, 274, 0, 276, 376, 279, 281, 283, 372,
0, 287, 376, 376, 291, 0, 293, 0, 0, 376,
298, 376, 376, 0, 0, 0, 0, 376, 376, 308,
310, 376, 376, 376, 315, 317, 0, 0, 321, 94,
95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
155, 164, 165, 156, 157, 158, 159, 160, 161, 162,
163, 166, 167, 168, 169, 170, 171, 172, 173, 174,
175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
225, 226, 227, 228, 229, 230, 231, 232, 233, 234,
235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
255, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 3, 0, 377, 6, 7, 323, 345,
351, 323, 356, 357, 0, 323, 0, 0, 352, 355,
0, 323, 323, 323, 323, 350, 323, 323, 323, 323,
353, 26, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 346, 0, 0, 0,
0, 0, 0, 67, 358, 376, 376, 335, 335, 335,
335, 335, 80, 81, 0, -2, 83, 0, 85, 349,
86, 0, 0, 0, 0, 0, 0, 0, 0, 269,
365, 366, 0, 0, 275, 363, 376, 280, 282, 0,
285, -2, 286, 288, 376, 0, 0, 0, 0, 297,
363, 300, 376, 0, 0, 0, 0, 306, 307, 309,
311, 312, 313, 314, 316, 318, 0, 0, 363, 4,
10, 0, 11, 12, 337, 0, 339, 0, 342, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 28, 29, 30, 31, 32, 0, 35, 0, 38,
0, 40, 0, 0, 45, 0, 48, 49, 0, 54,
347, 0, 0, 0, 0, 0, 0, 68, 69, 376,
376, 0, 376, 376, 376, 376, 376, 376, 376, 376,
82, 84, 87, 88, 89, 0, 91, 354, 92, 93,
268, 271, 360, 361, 273, -2, 368, 376, 278, 284,
371, 373, 374, 289, 290, 292, 294, 295, 0, -2,
301, 302, 303, 304, 305, 319, 0, -2, 324, 0,
326, 328, 0, 0, 0, 0, 344, 33, 34, 36,
37, 39, 41, 42, 43, 44, 46, 47, 50, 51,
52, 53, 55, 57, 56, 58, 59, 60, 61, 62,
63, 64, 65, 66, 70, 71, 336, 72, 73, 74,
75, 76, 77, 78, 79, 90, 359, 0, 367, 0,
364, 370, 296, 320, 0, 0, 376, 0, 0, 0,
0, 340, 341, 343, 362, 369, 325, 0, 331, 0,
330, 332, 0, 327, 329, 0, 0, 0, 0, 0,
338, 333, 334 };
#ifndef lint
static char yaccpar_sccsid[] = "@(#)yaccpar 4.1 (Berkeley) 2/11/83";
#endif
#
# define YYFLAG -1000
# define YYERROR goto yyerrlab
# define YYACCEPT return(0)
# define YYABORT return(1)
/* parser for yacc output */
#ifdef YYDEBUG
int yydebug = 0; /* 1 for debugging */
#endif
YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
int yychar = -1; /* current input token number */
int yynerrs = 0; /* number of errors */
short yyerrflag = 0; /* error recovery flag */
yyparse() {
short yys[YYMAXDEPTH];
short yyj, yym;
register YYSTYPE *yypvt;
register short yystate, *yyps, yyn;
register YYSTYPE *yypv;
register short *yyxi;
yystate = 0;
yychar = -1;
yynerrs = 0;
yyerrflag = 0;
yyps= &yys[-1];
yypv= &yyv[-1];
yystack: /* put a state and value onto the stack */
#ifdef YYDEBUG
if( yydebug ) printf( "state %d, char 0%o\n", yystate, yychar );
#endif
if( ++yyps> &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); }
*yyps = yystate;
++yypv;
*yypv = yyval;
yynewstate:
yyn = yypact[yystate];
if( yyn<= YYFLAG ) goto yydefault; /* simple state */
if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;
if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
yychar = -1;
yyval = yylval;
yystate = yyn;
if( yyerrflag > 0 ) --yyerrflag;
goto yystack;
}
yydefault:
/* default state action */
if( (yyn=yydef[yystate]) == -2 ) {
if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
/* look through exception table */
for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */
while( *(yyxi+=2) >= 0 ){
if( *yyxi == yychar ) break;
}
if( (yyn = yyxi[1]) < 0 ) return(0); /* accept */
}
if( yyn == 0 ){ /* error */
/* error ... attempt to resume parsing */
switch( yyerrflag ){
case 0: /* brand new error */
yyerror( "syntax error" );
yyerrlab:
++yynerrs;
case 1:
case 2: /* incompletely recovered error ... try again */
yyerrflag = 3;
/* find a state where "error" is a legal shift action */
while ( yyps >= yys ) {
yyn = yypact[*yyps] + YYERRCODE;
if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
yystate = yyact[yyn]; /* simulate a shift of "error" */
goto yystack;
}
yyn = yypact[*yyps];
/* the current yyps has no shift onn "error", pop stack */
#ifdef YYDEBUG
if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
#endif
--yyps;
--yypv;
}
/* there is no state on the stack with an error shift ... abort */
yyabort:
return(1);
case 3: /* no shift yet; clobber input char */
#ifdef YYDEBUG
if( yydebug ) printf( "error recovery discards char %d\n", yychar );
#endif
if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
yychar = -1;
goto yynewstate; /* try again in the same state */
}
}
/* reduction by production yyn */
#ifdef YYDEBUG
if( yydebug ) printf("reduce %d\n",yyn);
#endif
yyps -= yyr2[yyn];
yypvt = yypv;
yypv -= yyr2[yyn];
yyval = yypv[1];
yym=yyn;
/* consult goto table to find next state */
yyn = yyr1[yyn];
yyj = yypgo[yyn] + *yyps + 1;
if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
switch(yym){
case 1:
# line 370 "parser.y"
{scanner_start_line (); clear_labels ();} break;
case 3:
# line 375 "parser.y"
{
this_line_labels =
cons_label (record_label
((char *)yypvt[-1],
(text_dir ? current_text_pc ()
: current_data_pc ())),
this_line_labels);
} break;
case 4:
# line 385 "parser.y"
{
label *l = record_label ((char *) yypvt[-2], (mem_addr) yypvt[-0]);
l->const_flag = 1;
clear_labels ();
} break;
case 6:
# line 397 "parser.y"
{
clear_labels ();
LINE_PARSE_DONE;
} break;
case 7:
# line 403 "parser.y"
{
clear_labels ();
LINE_PARSE_DONE;
} break;
case 8:
# line 409 "parser.y"
{
clear_labels ();
LINE_PARSE_DONE;
} break;
case 9:
# line 414 "parser.y"
{
clear_labels ();
FILE_PARSE_DONE;
} break;
case 10:
# line 423 "parser.y"
{
i_type_inst (yypvt[-2] == Y_LD_POP ? Y_LW_OP : yypvt[-2],
yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
addr_expr_imm ((addr_expr *)yypvt[-0]));
if (yypvt[-2] == Y_LD_POP)
i_type_inst_free (Y_LW_OP,
yypvt[-1] + 1,
addr_expr_reg ((addr_expr *)yypvt[-0]),
incr_expr_offset (addr_expr_imm ((addr_expr *)yypvt[-0]),
4));
free (((addr_expr *)yypvt[-0])->imm);
free ((addr_expr *)yypvt[-0]);
} break;
case 11:
# line 439 "parser.y"
{
i_type_inst (yypvt[-2], yypvt[-1], addr_expr_reg ((addr_expr *)yypvt[-0]),
addr_expr_imm ((addr_expr *)yypvt[-0]));
free (((addr_expr *)yypvt[-0])->imm);
free ((addr_expr *)yypvt[-0]);
} break;
case 12:
# line 447 "parser.y"
{
i_type_inst_free (yypvt[-2], yypvt[-1], 0, (imm_expr *)yypvt[-0]);
} break;
case 13:
# line 453 "parser.y"
{
if (addr_expr_reg ((addr_expr *)yypvt[-0]))
i_type_inst (Y_ADDI_OP, yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
addr_expr_imm ((addr_expr *)yypvt[-0]));
else
i_type_inst (Y_LUI_OP, yypvt[-1], 0,
addr_expr_imm ((addr_expr *)yypvt[-0]));
free (((addr_expr *)yypvt[-0])->imm);
free ((addr_expr *)yypvt[-0]);
} break;
case 14:
# line 467 "parser.y"
{
i_type_inst_free (Y_ORI_OP, yypvt[-1], 0, (imm_expr *)yypvt[-0]);
} break;
case 15:
# line 473 "parser.y"
{
int *x = (int *) yypvt[-0];
i_type_inst (Y_ORI_OP, 1, 0, const_imm_expr (*x));
r_type_inst (Y_MTC1_OP, yypvt[-1], 0, 1);
i_type_inst (Y_ORI_OP, 1, 0, const_imm_expr (*(x+1)));
r_type_inst (Y_MTC1_OP, yypvt[-1] + 1, 0, 1);
} break;
case 16:
# line 484 "parser.y"
{
float x = * ((double *) yypvt[-0]);
int *y = (int *) &x;
i_type_inst (Y_ORI_OP, 1, 0, const_imm_expr (*y));
r_type_inst (Y_MTC1_OP, yypvt[-1], 0, 1);
} break;
case 17:
# line 494 "parser.y"
{
#ifdef BIGENDIAN
i_type_inst (Y_LWL_OP, yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
addr_expr_imm ((addr_expr *)yypvt[-0]));
i_type_inst_free (Y_LWR_OP, yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
incr_expr_offset (addr_expr_imm ((addr_expr *)yypvt[-0]),
3));
#else
i_type_inst_free (Y_LWL_OP, yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
incr_expr_offset (addr_expr_imm ((addr_expr *)yypvt[-0]),
3));
i_type_inst (Y_LWR_OP, yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
addr_expr_imm ((addr_expr *)yypvt[-0]));
#endif
free (((addr_expr *)yypvt[-0])->imm);
free ((addr_expr *)yypvt[-0]);
} break;
case 18:
# line 518 "parser.y"
{
#ifdef BIGENDIAN
i_type_inst ((yypvt[-2] == Y_ULH_POP ? Y_LB_OP : Y_LBU_OP),
yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
addr_expr_imm ((addr_expr *)yypvt[-0]));
i_type_inst_free (Y_LBU_OP, 1,
addr_expr_reg ((addr_expr *)yypvt[-0]),
incr_expr_offset (addr_expr_imm ((addr_expr *)yypvt[-0]),
1));
#else
i_type_inst_free ((yypvt[-2] == Y_ULH_POP ? Y_LB_OP : Y_LBU_OP),
yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
incr_expr_offset (addr_expr_imm ((addr_expr *)yypvt[-0]),
1));
i_type_inst (Y_LBU_OP, 1,
addr_expr_reg ((addr_expr *)yypvt[-0]),
addr_expr_imm ((addr_expr *)yypvt[-0]));
#endif
r_sh_type_inst (Y_SLL_OP, yypvt[-1], yypvt[-1], 8);
r_type_inst (Y_OR_OP, yypvt[-1], yypvt[-1], 1);
free (((addr_expr *)yypvt[-0])->imm);
free ((addr_expr *)yypvt[-0]);
} break;
case 19:
# line 546 "parser.y"
{
i_type_inst (Y_LWC1_OP, yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
addr_expr_imm ((addr_expr *)yypvt[-0]));
if (yypvt[-2] == Y_L_D_POP)
i_type_inst_free (Y_LWC1_OP, yypvt[-1] + 1,
addr_expr_reg ((addr_expr *)yypvt[-0]),
incr_expr_offset (addr_expr_imm ((addr_expr *)yypvt[-0]),
4));
free (((addr_expr *)yypvt[-0])->imm);
free ((addr_expr *)yypvt[-0]);
} break;
case 20:
# line 561 "parser.y"
{
i_type_inst (yypvt[-2] == Y_SD_POP ? Y_SW_OP : yypvt[-2],
yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
addr_expr_imm ((addr_expr *)yypvt[-0]));
if (yypvt[-2] == Y_SD_POP)
i_type_inst_free (Y_SW_OP, yypvt[-1] + 1,
addr_expr_reg ((addr_expr *)yypvt[-0]),
incr_expr_offset (addr_expr_imm ((addr_expr *)yypvt[-0]),
4));
free (((addr_expr *)yypvt[-0])->imm);
free ((addr_expr *)yypvt[-0]);
} break;
case 21:
# line 577 "parser.y"
{
i_type_inst (yypvt[-2], yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
addr_expr_imm ((addr_expr *)yypvt[-0]));
free (((addr_expr *)yypvt[-0])->imm);
free ((addr_expr *)yypvt[-0]);
} break;
case 22:
# line 587 "parser.y"
{
#ifdef BIGENDIAN
i_type_inst (Y_SWL_OP, yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
addr_expr_imm ((addr_expr *)yypvt[-0]));
i_type_inst_free (Y_SWR_OP, yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
incr_expr_offset (addr_expr_imm ((addr_expr *)yypvt[-0]),
3));
#else
i_type_inst_free (Y_SWL_OP, yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
incr_expr_offset (addr_expr_imm ((addr_expr *)yypvt[-0]),
3));
i_type_inst (Y_SWR_OP, yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
addr_expr_imm ((addr_expr *)yypvt[-0]));
#endif
free (((addr_expr *)yypvt[-0])->imm);
free ((addr_expr *)yypvt[-0]);
} break;
case 23:
# line 611 "parser.y"
{
i_type_inst (Y_SB_OP, yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
addr_expr_imm ((addr_expr *)yypvt[-0]));
r_sh_type_inst (Y_SRL_OP, 1, yypvt[-1], 8);
i_type_inst_free (Y_SB_OP, 1,
addr_expr_reg ((addr_expr *)yypvt[-0]),
incr_expr_offset (addr_expr_imm ((addr_expr *)yypvt[-0]),
1));
free (((addr_expr *)yypvt[-0])->imm);
free ((addr_expr *)yypvt[-0]);
} break;
case 24:
# line 626 "parser.y"
{
i_type_inst (Y_SWC1_OP, yypvt[-1],
addr_expr_reg ((addr_expr *)yypvt[-0]),
addr_expr_imm ((addr_expr *)yypvt[-0]));
if (yypvt[-2] == Y_S_D_POP)
i_type_inst_free (Y_SWC1_OP, yypvt[-1] + 1,
addr_expr_reg ((addr_expr *)yypvt[-0]),
incr_expr_offset (addr_expr_imm ((addr_expr *)yypvt[-0]),
4));
free (((addr_expr *)yypvt[-0])->imm);
free ((addr_expr *)yypvt[-0]);
} break;
case 25:
# line 641 "parser.y"
{
r_type_inst (yypvt[-0], 0, 0, 0);
} break;
case 26:
# line 647 "parser.y"
{
if (yypvt[-0] == 1)
yyerror ("Breakpoint 1 is reserved for debugger");
r_type_inst (yypvt[-1], yypvt[-0], 0, 0);
} break;
case 27:
# line 655 "parser.y"
{
nop_inst ();
} break;
case 28:
# line 661 "parser.y"
{
if (yypvt[-1] != yypvt[-0])
r_type_inst (Y_ADDU_OP, yypvt[-1], 0, yypvt[-0]);
i_type_inst_free (Y_BGEZ_OP, 0, yypvt[-0], branch_offset (2));
r_type_inst (Y_SUB_OP, yypvt[-1], 0, yypvt[-0]);
} break;
case 29:
# line 671 "parser.y"
{
r_type_inst (Y_SUB_OP, yypvt[-1], 0, yypvt[-0]);
} break;
case 30:
# line 677 "parser.y"
{
r_type_inst (Y_SUBU_OP, yypvt[-1], 0, yypvt[-0]);
} break;
case 31:
# line 683 "parser.y"
{
r_type_inst (Y_NOR_OP, yypvt[-1], yypvt[-0], 0);
} break;
case 32:
# line 689 "parser.y"
{
r_type_inst (Y_ADDU_OP, yypvt[-1], 0, yypvt[-0]);
} break;
case 33:
# line 695 "parser.y"
{
r_type_inst (yypvt[-3], yypvt[-2], yypvt[-1], yypvt[-0]);
} break;
case 34:
# line 701 "parser.y"
{
i_type_inst_free (op_to_imm_op (yypvt[-3]), yypvt[-2], yypvt[-1], (imm_expr *)yypvt[-0]);
} break;
case 35:
# line 707 "parser.y"
{
i_type_inst_free (op_to_imm_op (yypvt[-2]), yypvt[-1], yypvt[-1], (imm_expr *)yypvt[-0]);
} break;
case 36:
# line 713 "parser.y"
{
r_type_inst (yypvt[-3], yypvt[-2], yypvt[-0], yypvt[-1]);
} break;
case 37:
# line 719 "parser.y"
{
r_sh_type_inst (op_to_imm_op (yypvt[-3]), yypvt[-2], yypvt[-1], yypvt[-0]);
} break;
case 38:
# line 725 "parser.y"
{
r_sh_type_inst (op_to_imm_op (yypvt[-2]), yypvt[-1], yypvt[-1], yypvt[-0]);
} break;
case 39:
# line 731 "parser.y"
{
i_type_inst_free (yypvt[-3], yypvt[-2], yypvt[-1], (imm_expr *)yypvt[-0]);
} break;
case 40:
# line 737 "parser.y"
{
i_type_inst_free (yypvt[-2], yypvt[-1], yypvt[-1], (imm_expr *)yypvt[-0]);
} break;
case 41:
# line 743 "parser.y"
{
r_sh_type_inst (yypvt[-3], yypvt[-2], yypvt[-1], yypvt[-0]);
} break;
case 42:
# line 749 "parser.y"
{
r_type_inst (imm_op_to_op (yypvt[-3]), yypvt[-2], yypvt[-1], yypvt[-0]);
} break;
case 43:
# line 755 "parser.y"
{
r_type_inst (yypvt[-3], yypvt[-2], yypvt[-1], yypvt[-0]);
} break;
case 44:
# line 761 "parser.y"
{
if (bare_machine)
yyerror ("Immediate form not allowed in bare machine");
else
{
if (!zero_imm ((imm_expr *)yypvt[-0]))
/* Use $at */
i_type_inst (Y_ORI_OP, 1, 0, (imm_expr *)yypvt[-0]);
r_type_inst (yypvt[-3],
yypvt[-2],
yypvt[-1],
(zero_imm ((imm_expr *)yypvt[-0]) ? 0 : 1));
}
free ((imm_expr *)yypvt[-0]);
} break;
case 45:
# line 779 "parser.y"
{
if (bare_machine)
yyerror ("Immediate form not allowed in bare machine");
else
{
if (!zero_imm ((imm_expr *)yypvt[-0]))
/* Use $at */
i_type_inst (Y_ORI_OP, 1, 0, (imm_expr *)yypvt[-0]);
r_type_inst (yypvt[-2],
yypvt[-1],
yypvt[-1],
(zero_imm ((imm_expr *)yypvt[-0]) ? 0 : 1));
}
free ((imm_expr *)yypvt[-0]);
} break;
case 46:
# line 797 "parser.y"
{
r_type_inst (yypvt[-3], yypvt[-2], yypvt[-1], yypvt[-0]);
} break;
case 47:
# line 803 "parser.y"
{
int val = eval_imm_expr (yypvt[-0]);
if (bare_machine)
yyerror ("Immediate form not allowed in bare machine");
else
i_type_inst (yypvt[-3] == Y_SUB_OP ? Y_ADDI_OP
: yypvt[-3] == Y_SUBU_OP ? Y_ADDIU_OP
: (fatal_error ("Bad SUB_OP\n"), 0),
yypvt[-2],
yypvt[-1],
make_imm_expr ( -val, NULL, 0));
free ((imm_expr *)yypvt[-0]);
} break;
case 48:
# line 820 "parser.y"
{
int val = eval_imm_expr (yypvt[-0]);
if (bare_machine)
yyerror ("Immediate form not allowed in bare machine");
else
i_type_inst (yypvt[-2] == Y_SUB_OP ? Y_ADDI_OP
: yypvt[-2] == Y_SUBU_OP ? Y_ADDIU_OP
: (fatal_error ("Bad SUB_OP\n"), 0),
yypvt[-1],
yypvt[-1],
make_imm_expr (-val, NULL, 0));
free ((imm_expr *)yypvt[-0]);
} break;
case 49:
# line 837 "parser.y"
{
/* The hardware divide operation (ignore 1st arg) */
if (yypvt[-2] != Y_DIV_OP && yypvt[-2] != Y_DIVU_OP)
yyerror ("Syntax error");
r_type_inst (yypvt[-2], 0, yypvt[-1], yypvt[-0]);
} break;
case 50:
# line 845 "parser.y"
{
/* Pseudo divide operations */
div_inst (yypvt[-3], yypvt[-2], yypvt[-1], yypvt[-0], 0);
} break;
case 51:
# line 851 "parser.y"
{
if (zero_imm ((imm_expr *)yypvt[-0]))
yyerror ("Divide by zero");
else
{
/* Use $at */
i_type_inst_free (Y_ORI_OP, 1, 0, (imm_expr *)yypvt[-0]);
div_inst (yypvt[-3], yypvt[-2], yypvt[-1], 1, 1);
}
} break;
case 52:
# line 864 "parser.y"
{
mult_inst (yypvt[-3], yypvt[-2], yypvt[-1], yypvt[-0]);
} break;
case 53:
# line 869 "parser.y"
{
if (zero_imm ((imm_expr *)yypvt[-0]))
r_type_inst (Y_ORI_OP, yypvt[-2], 0, 0);
else
{
/* Use $at */
i_type_inst_free (Y_ORI_OP, 1, 0, (imm_expr *)yypvt[-0]);
mult_inst (yypvt[-3], yypvt[-2], yypvt[-1], 1);
}
} break;
case 54:
# line 882 "parser.y"
{
r_type_inst (yypvt[-2], 0, yypvt[-1], yypvt[-0]);
} break;
case 55:
# line 888 "parser.y"
{
r_type_inst (Y_SUBU_OP, 1, 0, yypvt[-0]);
r_type_inst (Y_SLLV_OP, 1, 1, yypvt[-1]);
r_type_inst (Y_SRLV_OP, yypvt[-2], yypvt[-0], yypvt[-1]);
r_type_inst (Y_OR_OP, yypvt[-2], yypvt[-2], 1);
} break;
case 56:
# line 897 "parser.y"
{
r_type_inst (Y_SUBU_OP, 1, 0, yypvt[-0]);
r_type_inst (Y_SRLV_OP, 1, 1, yypvt[-1]);
r_type_inst (Y_SLLV_OP, yypvt[-2], yypvt[-0], yypvt[-1]);
r_type_inst (Y_OR_OP, yypvt[-2], yypvt[-2], 1);
} break;
case 57:
# line 906 "parser.y"
{
long dist = eval_imm_expr ((imm_expr *)yypvt[-0]);
r_sh_type_inst (Y_SLL_OP, 1, yypvt[-1], -dist);
r_sh_type_inst (Y_SRL_OP, yypvt[-2], yypvt[-1], dist);
r_type_inst (Y_OR_OP, yypvt[-2], yypvt[-2], 1);
free ((imm_expr *)yypvt[-0]);
} break;
case 58:
# line 917 "parser.y"
{
long dist = eval_imm_expr ((imm_expr *)yypvt[-0]);
r_sh_type_inst (Y_SRL_OP, 1, yypvt[-1], -dist);
r_sh_type_inst (Y_SLL_OP, yypvt[-2], yypvt[-1], dist);
r_type_inst (Y_OR_OP, yypvt[-2], yypvt[-2], 1);
free ((imm_expr *)yypvt[-0]);
} break;
case 59:
# line 929 "parser.y"
{
set_le_inst (yypvt[-3], yypvt[-2], yypvt[-1], yypvt[-0]);
} break;
case 60:
# line 934 "parser.y"
{
if (!zero_imm ((imm_expr *)yypvt[-0]))
/* Use $at */
i_type_inst (Y_ORI_OP, 1, 0, (imm_expr *)yypvt[-0]);
set_le_inst (yypvt[-3], yypvt[-2], yypvt[-1], (zero_imm ((imm_expr *)yypvt[-0]) ? 0 : 1));
free ((imm_expr *)yypvt[-0]);
} break;
case 61:
# line 944 "parser.y"
{
set_gt_inst (yypvt[-3], yypvt[-2], yypvt[-1], yypvt[-0]);
} break;
case 62:
# line 949 "parser.y"
{
if (!zero_imm ((imm_expr *)yypvt[-0]))
/* Use $at */
i_type_inst (Y_ORI_OP, 1, 0, (imm_expr *)yypvt[-0]);
set_gt_inst (yypvt[-3], yypvt[-2], yypvt[-1], (zero_imm ((imm_expr *)yypvt[-0]) ? 0 : 1));
free ((imm_expr *)yypvt[-0]);
} break;
case 63:
# line 960 "parser.y"
{
set_ge_inst (yypvt[-3], yypvt[-2], yypvt[-1], yypvt[-0]);
} break;
case 64:
# line 965 "parser.y"
{
if (!zero_imm ((imm_expr *)yypvt[-0]))
/* Use $at */
i_type_inst (Y_ORI_OP, 1, 0, (imm_expr *)yypvt[-0]);
set_ge_inst (yypvt[-3], yypvt[-2], yypvt[-1], (zero_imm ((imm_expr *)yypvt[-0]) ? 0 : 1));
free ((imm_expr *)yypvt[-0]);
} break;
case 65:
# line 975 "parser.y"
{
set_eq_inst (yypvt[-3], yypvt[-2], yypvt[-1], yypvt[-0]);
} break;
case 66:
# line 980 "parser.y"
{
if (!zero_imm ((imm_expr *)yypvt[-0]))
/* Use $at */
i_type_inst (Y_ORI_OP, 1, 0, (imm_expr *)yypvt[-0]);
set_eq_inst (yypvt[-3], yypvt[-2], yypvt[-1], (zero_imm ((imm_expr *)yypvt[-0]) ? 0 : 1));
free ((imm_expr *)yypvt[-0]);
} break;
case 67:
# line 990 "parser.y"
{
i_type_inst_free (yypvt[-1], 0, 0, (imm_expr *)yypvt[-0]);
} break;
case 68:
# line 996 "parser.y"
{
i_type_inst_free (yypvt[-2], 0, yypvt[-1], (imm_expr *)yypvt[-0]);
} break;
case 69:
# line 1002 "parser.y"
{
i_type_inst_free (yypvt[-2] == Y_BEQZ_POP ? Y_BEQ_OP : Y_BNE_OP,
0, yypvt[-1], (imm_expr *)yypvt[-0]);
} break;
case 70:
# line 1009 "parser.y"
{
i_type_inst_free (yypvt[-3], yypvt[-1], yypvt[-2], (imm_expr *)yypvt[-0]);
} break;
case 71:
# line 1014 "parser.y"
{
if (bare_machine)
yyerror ("Immediate form not allowed in bare machine");
else
{
if (zero_imm ((imm_expr *)yypvt[-1]))
i_type_inst (yypvt[-3], yypvt[-2], (zero_imm ((imm_expr *)yypvt[-1]) ? 0 : 1),
(imm_expr *)yypvt[-0]);
else
{
/* Use $at */
i_type_inst (Y_ORI_OP, 1, 0, (imm_expr *)yypvt[-1]);
i_type_inst (yypvt[-3], yypvt[-2], (zero_imm ((imm_expr *)yypvt[-1]) ? 0 : 1),
(imm_expr *)yypvt[-0]);
}
}
free ((imm_expr *)yypvt[-1]);
free ((imm_expr *)yypvt[-0]);
} break;
case 72:
# line 1036 "parser.y"
{
r_type_inst (yypvt[-3] == Y_BGT_POP ? Y_SLT_OP : Y_SLTU_OP,
1, yypvt[-1], yypvt[-2]); /* Use $at */
i_type_inst_free (Y_BNE_OP, 0, 1, (imm_expr *)yypvt[-0]);
} break;
case 73:
# line 1043 "parser.y"
{
if (yypvt[-3] == Y_BGT_POP)
{
/* Use $at */
i_type_inst_free (Y_SLTI_OP, 1, yypvt[-2],
incr_expr_offset ((imm_expr *)yypvt[-1], 1));
i_type_inst (Y_BEQ_OP, 0, 1, (imm_expr *)yypvt[-0]);
}
else
{
/* Use $at */
/* Can't add 1 to immediate since 0xffffffff+1 = 0 < 1 */
i_type_inst (Y_ORI_OP, 1, 0, (imm_expr *)yypvt[-1]);
i_type_inst_free (Y_BEQ_OP, yypvt[-2], 1, branch_offset (3));
r_type_inst (Y_SLTU_OP, 1, yypvt[-2], 1);
i_type_inst (Y_BEQ_OP, 0, 1, (imm_expr *)yypvt[-0]);
}
free ((imm_expr *)yypvt[-1]);
free ((imm_expr *)yypvt[-0]);
} break;
case 74:
# line 1066 "parser.y"
{
r_type_inst (yypvt[-3] == Y_BGE_POP ? Y_SLT_OP : Y_SLTU_OP,
1, yypvt[-2], yypvt[-1]); /* Use $at */
i_type_inst_free (Y_BEQ_OP, 0, 1, (imm_expr *)yypvt[-0]);
} break;
case 75:
# line 1073 "parser.y"
{
i_type_inst (yypvt[-3] == Y_BGE_POP ? Y_SLTI_OP : Y_SLTIU_OP,
1, yypvt[-2], (imm_expr *)yypvt[-1]); /* Use $at */
i_type_inst_free (Y_BEQ_OP, 0, 1, (imm_expr *)yypvt[-0]);
free ((imm_expr *)yypvt[-1]);
} break;
case 76:
# line 1082 "parser.y"
{
r_type_inst (yypvt[-3] == Y_BLT_POP ? Y_SLT_OP : Y_SLTU_OP,
1, yypvt[-2], yypvt[-1]); /* Use $at */
i_type_inst_free (Y_BNE_OP, 0, 1, (imm_expr *)yypvt[-0]);
} break;
case 77:
# line 1089 "parser.y"
{
i_type_inst (yypvt[-3] == Y_BLT_POP ? Y_SLTI_OP : Y_SLTIU_OP,
1, yypvt[-2], (imm_expr *)yypvt[-1]); /* Use $at */
i_type_inst_free (Y_BNE_OP, 0, 1, (imm_expr *)yypvt[-0]);
free ((imm_expr *)yypvt[-1]);
} break;
case 78:
# line 1098 "parser.y"
{
r_type_inst (yypvt[-3] == Y_BLE_POP ? Y_SLT_OP : Y_SLTU_OP,
1, yypvt[-1], yypvt[-2]); /* Use $at */
i_type_inst_free (Y_BEQ_OP, 0, 1, (imm_expr *)yypvt[-0]);
} break;
case 79:
# line 1105 "parser.y"
{
if (yypvt[-3] == Y_BLE_POP)
{
/* Use $at */
i_type_inst_free (Y_SLTI_OP, 1, yypvt[-2],
incr_expr_offset ((imm_expr *)yypvt[-1], 1));
i_type_inst (Y_BNE_OP, 0, 1, (imm_expr *)yypvt[-0]);
}
else
{
/* Use $at */
/* Can't add 1 to immediate since 0xffffffff+1 = 0 < 1 */
i_type_inst (Y_ORI_OP, 1, 0, (imm_expr *)yypvt[-1]);
i_type_inst (Y_BEQ_OP, yypvt[-2], 1, (imm_expr *)yypvt[-0]);
r_type_inst (Y_SLTU_OP, 1, yypvt[-2], 1);
i_type_inst (Y_BNE_OP, 0, 1, (imm_expr *)yypvt[-0]);
}
free ((imm_expr *)yypvt[-1]);
free ((imm_expr *)yypvt[-0]);
} break;
case 80:
# line 1128 "parser.y"
{
if ((yypvt[-1] == Y_J_OP) || (yypvt[-1] == Y_JR_OP))
j_type_inst (Y_J_OP, (imm_expr *)yypvt[-0]);
else if ((yypvt[-1] == Y_JAL_OP) || (yypvt[-1] == Y_JALR_OP))
j_type_inst (Y_JAL_OP, (imm_expr *)yypvt[-0]);
free ((imm_expr *)yypvt[-0]);
} break;
case 81:
# line 1138 "parser.y"
{
if ((yypvt[-1] == Y_J_OP) || (yypvt[-1] == Y_JR_OP))
r_type_inst (Y_JR_OP, 0, yypvt[-0], 0);
else if ((yypvt[-1] == Y_JAL_OP) || (yypvt[-1] == Y_JALR_OP))
r_type_inst (Y_JALR_OP, 31, yypvt[-0], 0);
} break;
case 82:
# line 1147 "parser.y"
{
if ((yypvt[-2] == Y_J_OP) || (yypvt[-2] == Y_JR_OP))
r_type_inst (Y_JR_OP, 0, yypvt[-0], 0);
else if ((yypvt[-2] == Y_JAL_OP) || (yypvt[-2] == Y_JALR_OP))
r_type_inst (Y_JALR_OP, yypvt[-1], yypvt[-0], 0);
} break;
case 83:
# line 1156 "parser.y"
{
i_type_inst_free ((yypvt[-1] == Y_BAL_POP ? Y_BGEZAL_OP : Y_BGEZ_OP),
0, 0, (imm_expr *)yypvt[-0]);
} break;
case 84:
# line 1164 "parser.y"
{
r_type_inst (yypvt[-2], yypvt[-1], yypvt[-0], 0);
} break;
case 85:
# line 1170 "parser.y"
{
r_type_inst (yypvt[-1], yypvt[-0], 0, 0);
} break;
case 86:
# line 1176 "parser.y"
{
r_type_inst (yypvt[-1], 0, yypvt[-0], 0);
} break;
case 87:
# line 1182 "parser.y"
{
if (yypvt[-2] == Y_MFC1_D_POP)
{
r_type_inst (Y_MFC1_OP, yypvt[-0], 0, yypvt[-1]);
r_type_inst (Y_MFC1_OP, yypvt[-0] + 1, 0, yypvt[-1] + 1);
}
else if (yypvt[-2] == Y_MTC1_D_POP)
{
r_type_inst (Y_MTC1_OP, yypvt[-0], 0, yypvt[-1]);
r_type_inst (Y_MTC1_OP, yypvt[-0] + 1, 0, yypvt[-1] + 1);
}
else
r_type_inst (yypvt[-2], yypvt[-0], 0, yypvt[-1]);
} break;
case 88:
# line 1199 "parser.y"
{
r_type_inst (yypvt[-2], yypvt[-0], 0, yypvt[-1]);
} break;
case 89:
# line 1205 "parser.y"
{
r_type_inst (yypvt[-2], yypvt[-1], yypvt[-0], 0);
} break;
case 90:
# line 1211 "parser.y"
{
r_type_inst (yypvt[-3], yypvt[-2], yypvt[-1], yypvt[-0]);
} break;
case 91:
# line 1217 "parser.y"
{
r_type_inst (yypvt[-2], yypvt[-1], yypvt[-0], 0);
} break;
case 92:
# line 1223 "parser.y"
{
r_type_inst (yypvt[-2], yypvt[-1], yypvt[-0], 0);
} break;
case 93:
# line 1229 "parser.y"
{
r_cond_type_inst (yypvt[-2], yypvt[-1], yypvt[-0]);
} break;
case 269:
# line 1502 "parser.y"
{
align_data (yypvt[-0]);
} break;
case 270:
# line 1506 "parser.y"
{null_term = 0;} break;
case 271:
# line 1507 "parser.y"
{
if (text_dir)
yyerror ("Can't put data in text segment");
} break;
case 272:
# line 1512 "parser.y"
{null_term = 1;} break;
case 273:
# line 1513 "parser.y"
{
if (text_dir)
yyerror ("Can't put data in text segment");
} break;
case 276:
# line 1525 "parser.y"
{store_op = store_byte;} break;
case 277:
# line 1527 "parser.y"
{
if (text_dir)
yyerror ("Can't put data in text segment");
} break;
case 278:
# line 1534 "parser.y"
{
align_data (2);
if (lookup_label ((char *)yypvt[-1])->addr == 0)
record_label ((char *)yypvt[-1], current_data_pc ());
increment_data_pc (yypvt[-0]);
} break;
case 279:
# line 1543 "parser.y"
{
user_kernel_data_segment (0);
data_dir = 1; text_dir = 0;
enable_data_alignment ();
} break;
case 280:
# line 1550 "parser.y"
{
user_kernel_data_segment (0);
data_dir = 1; text_dir = 0;
enable_data_alignment ();
set_data_pc (yypvt[-0]);
} break;
case 281:
# line 1559 "parser.y"
{
user_kernel_data_segment (1);
data_dir = 1; text_dir = 0;
enable_data_alignment ();
} break;
case 282:
# line 1566 "parser.y"
{
user_kernel_data_segment (1);
data_dir = 1; text_dir = 0;
enable_data_alignment ();
set_data_pc (yypvt[-0]);
} break;
case 283:
# line 1575 "parser.y"
{
store_op = store_double;
if (data_dir) set_data_alignment(3);
} break;
case 284:
# line 1580 "parser.y"
{
if (text_dir)
yyerror ("Can't put data in text segment");
} break;
case 290:
# line 1598 "parser.y"
{
extern_directive ((char *)yypvt[-1], yypvt[-0]);
} break;
case 291:
# line 1604 "parser.y"
{
fatal_error ("File contains an .err directive\n");
} break;
case 293:
# line 1613 "parser.y"
{
store_op = store_float;
if (data_dir) set_data_alignment (2);
} break;
case 294:
# line 1618 "parser.y"
{
if (text_dir)
yyerror ("Can't put data in text segment");
} break;
case 297:
# line 1630 "parser.y"
{
make_label_global ((char *)yypvt[-0]);
} break;
case 298:
# line 1636 "parser.y"
{
store_op = store_half;
if (data_dir) set_data_alignment (1);
} break;
case 299:
# line 1641 "parser.y"
{
if (text_dir)
yyerror ("Can't put data in text segment");
} break;
case 300:
# line 1648 "parser.y"
{
record_label ((char *)yypvt[-0], (text_dir ? current_text_pc ()
: current_data_pc ()));
} break;
case 301:
# line 1655 "parser.y"
{
lcomm_directive ((char *)yypvt[-1], yypvt[-0]);
} break;
case 307:
# line 1673 "parser.y"
{
yyerror ("Warning: repeat directive ignored");
} break;
case 308:
# line 1679 "parser.y"
{
user_kernel_data_segment (0);
data_dir = 1; text_dir = 0;
enable_data_alignment ();
} break;
case 309:
# line 1686 "parser.y"
{
user_kernel_data_segment (0);
data_dir = 1; text_dir = 0;
enable_data_alignment ();
set_data_pc (yypvt[-0]);
} break;
case 310:
# line 1695 "parser.y"
{
user_kernel_data_segment (0);
data_dir = 1; text_dir = 0;
enable_data_alignment ();
} break;
case 311:
# line 1702 "parser.y"
{
user_kernel_data_segment (0);
data_dir = 1; text_dir = 0;
enable_data_alignment ();
set_data_pc (yypvt[-0]);
} break;
case 312:
# line 1711 "parser.y"
{
if (streq ((char *)yypvt[-0], "noat"))
noat_flag = 1;
else if (streq ((char *)yypvt[-0], "at"))
noat_flag = 0;
} break;
case 313:
# line 1720 "parser.y"
{
if (data_dir)
increment_data_pc (yypvt[-0]);
else if (text_dir)
increment_text_pc (yypvt[-0]);
} break;
case 314:
# line 1729 "parser.y"
{
yyerror ("Warning: struct directive ignored");
} break;
case 315:
# line 1735 "parser.y"
{
user_kernel_text_segment (0);
data_dir = 0; text_dir = 1;
enable_data_alignment ();
} break;
case 316:
# line 1742 "parser.y"
{
user_kernel_text_segment (0);
data_dir = 0; text_dir = 1;
enable_data_alignment ();
set_text_pc (yypvt[-0]);
} break;
case 317:
# line 1751 "parser.y"
{
user_kernel_text_segment (1);
data_dir = 0; text_dir = 1;
enable_data_alignment ();
} break;
case 318:
# line 1758 "parser.y"
{
user_kernel_text_segment (1);
data_dir = 0; text_dir = 1;
enable_data_alignment ();
set_text_pc (yypvt[-0]);
} break;
case 321:
# line 1772 "parser.y"
{
store_op = store_word_data;
if (data_dir) set_data_alignment (2);
} break;
case 323:
# line 1782 "parser.y"
{only_id = 1;} break;
case 324:
# line 1782 "parser.y"
{only_id = 0; yyval = yypvt[-0];} break;
case 325:
# line 1785 "parser.y"
{
yyval = (int) make_addr_expr (0, NULL, yypvt[-1]);
} break;
case 326:
# line 1790 "parser.y"
{
yyval = (int) make_addr_expr (yypvt[-0], NULL, 0);
} break;
case 327:
# line 1795 "parser.y"
{
yyval = (int) make_addr_expr (yypvt[-3], NULL, yypvt[-1]);
} break;
case 328:
# line 1800 "parser.y"
{
yyval = (int) make_addr_expr (0, (char *)yypvt[-0], 0);
if (yypvt[-0]) free ((char *)yypvt[-0]);
} break;
case 329:
# line 1806 "parser.y"
{
yyval = (int) make_addr_expr (0, (char *)yypvt[-3], yypvt[-1]);
if (yypvt[-3]) free ((char *)yypvt[-3]);
} break;
case 330:
# line 1812 "parser.y"
{
yyval = (int) make_addr_expr (yypvt[-0], (char *)yypvt[-2], 0);
if (yypvt[-2]) free ((char *)yypvt[-2]);
} break;
case 331:
# line 1818 "parser.y"
{
yyval = (int) make_addr_expr (yypvt[-2], (char *)yypvt[-0], 0);
} break;
case 332:
# line 1823 "parser.y"
{
yyval = (int) make_addr_expr (- yypvt[-0], (char *)yypvt[-2], 0);
if (yypvt[-2]) free ((char *)yypvt[-2]);
} break;
case 333:
# line 1829 "parser.y"
{
yyval = (int) make_addr_expr (yypvt[-3], (char *)yypvt[-5], yypvt[-1]);
if (yypvt[-5]) free ((char *)yypvt[-5]);
} break;
case 334:
# line 1835 "parser.y"
{
yyval = (int) make_addr_expr (- yypvt[-3], (char *)yypvt[-5], yypvt[-1]);
if (yypvt[-5]) free ((char *)yypvt[-5]);
} break;
case 335:
# line 1842 "parser.y"
{only_id = 1;} break;
case 336:
# line 1842 "parser.y"
{only_id = 0; yyval = yypvt[-0];} break;
case 337:
# line 1845 "parser.y"
{
yyval = (int) make_imm_expr (yypvt[-0], NULL, 0);
} break;
case 338:
# line 1850 "parser.y"
{
yyval = (int) make_imm_expr (yypvt[-4] >> yypvt[-0], NULL, 0);
} break;
case 339:
# line 1855 "parser.y"
{
yyval = (int) make_imm_expr (0, (char *)yypvt[-0], 0);
} break;
case 340:
# line 1860 "parser.y"
{
yyval = (int) make_imm_expr (yypvt[-0], (char *)yypvt[-2], 0);
free ((char *)yypvt[-2]);
} break;
case 341:
# line 1866 "parser.y"
{
yyval = (int) make_imm_expr (- yypvt[-0], (char *)yypvt[-2], 0);
free ((char *)yypvt[-2]);
} break;
case 343:
# line 1876 "parser.y"
{yyval = yypvt[-2] + yypvt[-0];} break;
case 344:
# line 1879 "parser.y"
{
/* Y_INT '-' Y_INT */
if (yypvt[-0] >= 0)
yyerror ("Syntax error");
yyval = yypvt[-1] - yypvt[-0];
} break;
case 351:
# line 1900 "parser.y"
{
if (yypvt[-0] < 0 || yypvt[-0] > 31)
yyerror ("Register number out of range");
if (yypvt[-0] == 1 && !bare_machine && !noat_flag)
yyerror ("Register 1 is reserved for assembler");
yyval = yypvt[-0];
} break;
case 355:
# line 1915 "parser.y"
{
if (yypvt[-0] < 0 || yypvt[-0] > 31)
yyerror ("FP register number out of range");
yyval = yypvt[-0];
} break;
case 358:
# line 1930 "parser.y"
{
yyval = (int) make_imm_expr (- current_text_pc (), (char *)yypvt[-0],
1);
} break;
case 361:
# line 1942 "parser.y"
{
store_string ((char *)yypvt[-0], y_str_length, null_term);
free (yypvt[-0]);
} break;
case 362:
# line 1947 "parser.y"
{
int i;
for (i = 0; i < yypvt[-0]; i ++)
store_string ((char *)yypvt[-2], y_str_length, null_term);
free (yypvt[-2]);
} break;
case 363:
# line 1957 "parser.y"
{only_id = 1;} break;
case 364:
# line 1957 "parser.y"
{only_id = 0; yyval = yypvt[-0];} break;
case 366:
# line 1962 "parser.y"
{
label *l = lookup_label ((char *)yypvt[-0]);
if (l->addr == 0)
{
record_data_uses_symbol (current_data_pc (), l);
yyval = 0;
}
else
yyval = l->addr;
} break;
case 367:
# line 1976 "parser.y"
{
store_op (yypvt[-0]);
} break;
case 368:
# line 1980 "parser.y"
{
store_op (yypvt[-0]);
} break;
case 369:
# line 1984 "parser.y"
{
int i;
for (i = 0; i < yypvt[-0]; i ++)
store_op (yypvt[-2]);
} break;
case 370:
# line 1994 "parser.y"
{
store_op (yypvt[-0]);
} break;
case 371:
# line 1998 "parser.y"
{
store_op (yypvt[-0]);
} break;
case 372:
# line 2004 "parser.y"
{only_id = 1;} break;
case 373:
# line 2004 "parser.y"
{only_id = 0; yyval = yypvt[-0];} break;
case 375:
# line 2007 "parser.y"
{yyval = 0;} break;
case 376:
# line 2011 "parser.y"
{only_id = 1;} break;
case 377:
# line 2011 "parser.y"
{only_id = 0; yyval = yypvt[-0];} break;
}
goto yystack; /* stack new state and value */
}